package com.aier.controller.rights;

import com.aier.bean.common.CommonResult;
import com.aier.bean.rights.MenuNode;
import com.aier.service.rights.RightsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * 权限controller
 */

@Controller
@CrossOrigin
@RequestMapping("/rights")
public class RightsController {

    @Autowired
    private RightsService rightsService;

    @ResponseBody
    @RequestMapping("/get_by_staff_id")
    public CommonResult findRouteMenuNodeByStaffId(@RequestBody Map<String,String> map){
        MenuNode menuNode = rightsService.getRouteMenuNodeByStaffId(map.get("staffId"));
        return CommonResult.success(menuNode);
    }
}
